import request from "@/utils/request";

export function login(data) {
  return request({
    url: "/user/login",
    method: "post",
    data
  });
}

export function getInfo(id) {
  return request({
    url: "/user/" + id,
    method: "get"
  });
}

export function getUserList(data) {
  return request({
    url: "/user",
    method: "get",
    params: data
  });
}

export function addUserInfo(data) {
  // console.log(data);
  return request({
    url: "/user",
    method: "post",
    data: data
  });
}
export function delUserInfo(id) {
  // console.log(id);
  return request({
    url: "/user/" + id,
    method: "delete"
  });
}

export function editUserInfo(data) {
  console.log(data);
  return request({
    url: "/user/" + data.id,
    method: "put",
    data: data.data
  });
}


